package com.bugpool.leilema.tc.mapper;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bugpool.leilema.tc.bean.entity.SysDept;
import com.bugpool.leilema.tc.bean.req.SysDeptReq;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Queue;

/**
 * @Author wh
 * @Description
 * @Date 2023/6/8 10:54
 * @Version 1.0
 **/
@Mapper
public interface DeptMapper extends BaseMapper<SysDept> {
    /**
     * 根据条件查询
     *
     * @param sysDeptReq
     * @return
     */
    default List<SysDept> list(SysDeptReq sysDeptReq) {
        QueryWrapper<SysDept> wrapper=new QueryWrapper<>();
        wrapper.lambda().like(!StrUtil.isEmpty(sysDeptReq.getDeptName()),SysDept::getDeptName,sysDeptReq.getDeptName());
        return this.selectList(wrapper);
    }
}
